import { post } from '@/core/utils/http';
import type { Response, UserInfoType, GoodsFootprintType } from '@/core/models';

/**  上传头像 */
export const queryChangeAvatar = (data : any) : Promise<Response<any>> => {
	return post('Api/User/ChangeAvatar', {
		data,
	}, true);
}

/**  编辑用户信息 */
export const queryEditInfo = (data : any) : Promise<Response<any>> => {
	return post('Api/User/EditInfo', {
		data,
	}, true);
}

/**  用户修改密码 */
export const queryEditPwd = (data : any) : Promise<Response<any>> => {
	return post('Api/User/EditPwd', {
		data,
	}, true);
}

/**  获取订单数量 */
export const queryOrderStatusNum = (data : any) : Promise<Response<any>> => {
	return post('Api/Order/GetOrderStatusNum', {
		data,
	}, true);
}

/**  获取用户信息 */
export const queryUserInfo = () : Promise<Response<UserInfoType>> => {
	return post('Api/User/GetUserInfo', {}, true);
}

/**  判断用户是否是门店人员 */
export const queryUserIsClerk = () : Promise<Response<any>> => {
	return post('Api/Store/IsClerk', {}, true);
}

/**  获取商品浏览足迹 */
export const queryGoodsBrowsing = (data : any) : Promise<Response<{
	count : number;
	list : Array<GoodsFootprintType>
}>> => {
	return post('Api/User/Goodsbrowsing', {
		data,
	}, true);
}

/**  获取商品收藏关注列表 */
export const queryGoodscollectionList = (data : any) : Promise<Response<any>> => {
	return post('Api/User/GoodscollectionList', {
		data,
	}, true);
}

/**  商品收藏 关注/取消 */
export const queryGoodsCollection = (data : any) : Promise<Response<any>> => {
	return post('Api/User/GoodsCollectionCreateOrDelete', {
		data,
	}, true);
}

/**  用户已领取的优惠券列表 */
export const queryUserCoupon = (data : any) : Promise<Response<any>> => {
	return post('Api/Coupon/UserCoupon', {
		data,
	}, true);
}

/**  优惠券列表 */
export const queryCouponList = (data : any) : Promise<Response<any>> => {
	return post('Api/Coupon/CouponList', {
		data,
	});
}

/**  用户领取优惠券 */
export const queryReceiveCoupon = (data : any) : Promise<Response<any>> => {
	return post('Api/Coupon/GetCoupon', {
		data,
	}, true);
}

/**  获取我的发票列表 */
export const queryUserInvoiceList = (data : any) : Promise<Response<any>> => {
	return post('Api/User/UserInvoiceList', {
		data,
	}, true);
}

/** 积分记录 */
export const queryUserPointLog = (data : any) : Promise<Response<any>> => {
	return post('Api/User/UserPointLog', {
		data,
	}, true);
}

/** 发票模糊查询 */
export const queryTaxInfo = (data : any) : Promise<Response<any>> => {
	return post('Api/Order/GetTaxCode', {
		data,
	}, true);
}

/** 获取个人服务订单列表 */
export const queryServicesPageList = (data : any) : Promise<Response<any>> => {
	return post('Api/User/GetServicesPageList', {
		data,
	}, true);
}

/** 获取单个服务订单 */
export const queryServicesById = (data : any) : Promise<Response<any>> => {
	return post('Api/User/GetServicesById', {
		data,
	}, true);
}

/** 获取单个服务订单下面服务券 */
export const queryServicesTickets = (data : any) : Promise<Response<any>> => {
	return post('Api/User/GetServicesTickets', {
		data,
	}, true);
}

/** 删除商品浏览足迹 */
export const queryDelGoodsBrowsing = (data : any) : Promise<Response<any>> => {
	return post('Api/User/DelGoodsBrowsing', {
		data,
	}, true);
}